<?php
$this->pageTitle=Yii::app()->name . ' - 用户注册';
?>

<div id="signup">

			<div class="dashboard" id="dashboard">
		<?php if(Yii::app()->user->name=='admin'){?>
				<ul>
				<li><a href="<?php echo $this->createUrl('index'); ?>">用户列表</a><span></span></li>
				<li><a href="<?php echo $this->createUrl('admin'); ?>">用户管理</a><span></span></li>
				<li class="current"><a href="<?php echo $this->createUrl('create'); ?>">新建用户</a><span></span></li>
				</ul>
		<?php	}?>
			</div>
	<div id="content" class="signup-box">
		<div class="box">
			<div class="box-top"></div>
			<div class="box-content">
				<div class="head"><h2>注册</h2><span>&nbsp;或者 <a href="<?php echo $this->createUrl('user/login'); ?>">登录</a></span></div>
				<div class="sect">

					<?php $form=$this->beginWidget('CActiveForm', array(
						'id'=>'signup-user-form',
						'enableAjaxValidation'=>false,
						'htmlOptions'=>array('class'=>"validator")
					)); ?>
						<div class="field email">
							<?php echo $form->labelEx($model,'email',array('for'=>"signup-email-address")); ?>
							<?php echo $form->textField($model,'email',array('size'=>30,'maxlength'=>128,'id'=>"signup-email-address",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'email'); ?>
							<span class="hint">用于登录及找回密码，不会公开，请放心填写</span>
						</div>
						<div class="field username">
							<?php echo $form->labelEx($model,'username',array('for'=>"signup-username")); ?>
							<?php echo $form->textField($model,'username',array('size'=>30,'maxlength'=>32,'id'=>"signup-username",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'username'); ?>
							<span class="hint">填写4-16个字符，一个汉字为两个字符</span>
						</div>


						<div class="field password">
							<?php echo $form->labelEx($model,'password',array('for'=>"signup-password")); ?>
							<?php echo $form->passwordField($model,'password',array('size'=>30,'maxlength'=>32,'id'=>"signup-password",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'password'); ?>
							<span class="hint">为了您的帐号安全，建议密码最少设置为6个字符以上</span>
						</div>
						<div class="field password">
							<?php echo $form->labelEx($model,'repassword',array('for'=>"signup-password-confirm")); ?>
							<?php echo $form->passwordField($model,'repassword',array('size'=>30,'maxlength'=>32,'id'=>"signup-password-confirm",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'repassword'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'realname',array('for'=>"signup-realname")); ?>
							<?php echo $form->textField($model,'realname',array('size'=>30,'maxlength'=>32,'id'=>"signup-realname",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'realname'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'gender',array('for'=>"signup-gender")); ?>
							<?php echo $form->dropDownList($model,'gender',array('1'=>'男','2'=>'女'),array('id'=>"signup-realname",'class'=>"f-select")); ?>
							<?php echo $form->error($model,'gender'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'mobile',array('for'=>"signup-mobile")); ?>
							<?php echo $form->textField($model,'mobile',array('size'=>16,'maxlength'=>16,'id'=>"signup-mobile",'class'=>"number")); ?>
							<?php echo $form->error($model,'mobile'); ?>
							<span class="hint">手机号码是我们联系您的最重要方式</span>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'qq',array('for'=>"signup-qq")); ?>
							<?php echo $form->textField($model,'qq',array('size'=>11,'maxlength'=>12,'id'=>"signup-qq",'class'=>"number")); ?>
							<?php echo $form->error($model,'qq'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'city_id',array('id'=>"enter-address-city-label",'for'=>"signup-city")); ?>
							<?php echo $form->dropDownList($model,'city_id',Category::cityname(),array('class'=>"f-select f-city")); ?>
							<?php echo $form->error($model,'city_id'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'zipcode',array('for'=>"signup-zipcode")); ?>
							<?php echo $form->textField($model,'zipcode',array('size'=>6,'maxlength'=>6,'id'=>"signup-qq",'class'=>"number")); ?>
							<?php echo $form->error($model,'zipcode'); ?>
						</div>
						<div class="field">
							<?php echo $form->labelEx($model,'address',array('for'=>"signup-address")); ?>
							<?php echo $form->textField($model,'address',array('size'=>60,'maxlength'=>255,'id'=>"signup-qq",'class'=>"f-input")); ?>
							<?php echo $form->error($model,'address'); ?>
						</div>

						<div class="act">
							<?php echo CHtml::submitButton('注册',array('id'=>"signup-submit",'class'=>"formbutton")); ?>
						</div>
					<?php $this->endWidget(); ?>
					</table>
				</div>
			</div>
			<div class="box-bottom"></div>
		</div>
	</div>
	<div id="sidebar">
		<div class="sbox">
			<div class="sbox-top"></div>
			<div class="sbox-content">
				<div class="side-tip">
					<h2>已有账户？</h2>
					<p>请直接<a href="<?php echo $this->createUrl('user/login'); ?>">登录</a>。</p>
				</div>
			</div>
			<div class="sbox-bottom"></div>
		</div>
	</div>
</div>
